package test;

import java.util.Iterator;
import java.util.TreeSet;

import reflection.Dog;

public class javaNeiCun {
	public static <E> void main(String[] args) {
		String s1 = "china";
		String s2 = "china";
		String s3 = "china";
		// s1=s1.replace("c", "p");
		String ss1 = new String("china");
		String ss2 = new String("china");
		String ss3 = new String("china");
		System.out.println(s1 == s2);
		System.out.println(s1 == s3);
		System.out.println(s1 == ss1);
		ss1 = ss1.intern();
		System.out.println(s1.equals(ss1));
		System.out.println("asdsadasd::" + s1);

		Dog d1 = new Dog();
		Dog d2 = new Dog();
		System.out.println(d1 == d2);
		System.out.println(d1.equals(d2));
		System.out.println(d1.hashCode());
		System.out.println(d2.hashCode());

		String k = new String("ac");
		String k1 = "ac";
		System.out.println(k == k1);
		System.out.println(k.equals(k1));

		int i = 1;
		int j = 1;
		System.out.println(i == j);
		
		String s11 = "abc" + "def";
		String s22=new String(s11);
         if(s11.equals(s22))
         System.out.println(".equalssucceeded");
         if(s11==s22)
        	System.out.println("==succeeded");
         
         String str1="hello";
         String str2="he"+ new String("llo");
         System.out.println(str1==str2);
          String s="as";
          
          String y="hello";
          String u="hello";
          char t[] = {'h','e','l','l','o'};
          System.out.println(y.equals(u));
          System.out.println(y.equals(t));
          TreeSet<String> tree = new TreeSet<String>();
          tree.add("1");
          tree.add("a");
          tree.add("2");
          tree.add("b");
          tree.add("3");
          tree.add("c");
          tree.add("@");
          tree.add("A");
          tree.add("Z");
          Iterator<String> it=tree.iterator();
          while(it.hasNext()){
        	  System.out.println(it.next());
          }
          
          
	}
}
